// [[ OnflowGenerator Entity UUID: 334d724ba7d143a49549086b85b568de ]]
package com.itdct.onflow.system.message.entity

import com.baomidou.mybatisplus.annotation.TableName
import com.itdct.onflow.core.annotation.Column
import com.itdct.onflow.core.annotation.ColumnRelateDict
import com.itdct.onflow.core.annotation.ColumnRelateId
import com.itdct.onflow.core.annotation.TableDescription
import com.itdct.onflow.core.entity.BaseUserEntity
import com.itdct.onflow.system.account.entity.SysAccountEntity

/**
 * @author Zhouwx
 * @date 2025/8/21 19:45:10
 * @version 1.0
 * @description
 */
@TableDescription("系统站内信")
@TableName("sys_message")
class SysMessageEntity : BaseUserEntity() {
    @Column(comment = "标题", nullable = false, length = 200, sort = 10, forSelect = true)
    var title = ""

    @Column(comment = "内容", nullable = false, length = 5000, sort = 20)
    var content = ""

    @Column(comment = "是否系统发送", nullable = false, defaultValue = "0", sort = 30)
    var systemSend = false

    @ColumnRelateId(targetClass = SysAccountEntity::class, targetFieldName = "name")
    @Column(comment = "接收人", nullable = false, indexed = true, defaultValue = "0", sort = 40)
    var receiveUser = 0L

    @ColumnRelateId(targetClass = SysAccountEntity::class, targetFieldName = "name")
    @Column(comment = "发送人", nullable = false, indexed = true, defaultValue = "0", sort = 50)
    var sendUser = 0L

    @Column(comment = "跳转链接", length = 500, sort = 60)
    var url: String? = null

    @Column(comment = "已读状态", nullable = false, defaultValue = "0", sort = 70)
    var readState = false

    @ColumnRelateDict(dictCode = "platformType")
    @Column(comment = "平台类型", nullable = false, length = 100, defaultValue = "onflow-backend", indexed = true, sort = 80)
    var platformType = ""

    @ColumnRelateDict(dictCode = "sysModuleName")
    @Column(comment = "模块名称", nullable = false, length = 100, defaultValue = "", indexed = true, sort = 90)
    var moduleName = ""

    @Column(comment = "备注", length = 500, sort = 100)
    var remark: String? = null
}